package com.doodle.common.utils;

import android.content.Context;
import android.database.Cursor;

import com.doodle.common.data.Bean;
import com.doodle.common.data.BeanListCursor;

import java.util.List;

public abstract class FeedMoreCursorLoader<T extends Bean> extends
		FeedMoreLoader<T, Cursor> {

	public FeedMoreCursorLoader(Context context, int requestCount) {
		super(context, requestCount);
	}

	@Override
	protected Cursor getComposedResult(List<T> data) {
		if (data.size() > 0) {
			BeanListCursor<T> cursor = new BeanListCursor<T>(mData.get(0).getSchema().getColumnNames());
			cursor.setList(data);
			return cursor;
		}
		return null;
	}
}
